﻿using System;
using System.IO;

public partial class Write : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Directory.CreateDirectory(MapPath("App_Data"));
            string s = new StreamReader(Request.InputStream).ReadToEnd();
            File.AppendAllText(MapPath("App_Data/" + Request.QueryString["id"] + ".txt"), s);
        }
        catch (Exception ex)
        {
            Response.StatusCode = 500;
            Response.Write("<pre>" + ex.Source + " " + ex.Message + "\n" + ex.StackTrace + "</pre>");
        }
    }
}
